package com.lzx.blog.controller;

import com.lzx.blog.service.ArticleService;
import com.lzx.blog.utils.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 程序员星星
 * @date 2023/4/12
 * @Description
 */
@CrossOrigin
@RestController
@RequestMapping("/article")
public class ArticleController {
    @Resource
    private ArticleService articleService;

    @GetMapping("/getList")
    public R getArticleList() {
        return R.ok().data("list", articleService.list());
    }
}
